import os


class Settings:
    """应用配置"""
    
    def __init__(self):
        # 钉钉配置
        self.DINGTALK_APP_KEY = os.getenv("DINGTALK_APP_KEY", "dingq69wq1onm95ducdj")
        self.DINGTALK_APP_SECRET = os.getenv("DINGTALK_APP_SECRET", "JZeDL3oLaOnEwZj0BBQk5DAoap48XRJY5CRpOsIgSjeiX4MHpi5dBgnq7xIbs53m")
        self.DINGTALK_REDIRECT_URI = os.getenv("DINGTALK_REDIRECT_URI", "http://localhost:5173/dingtalk/callback")
        
        # 前端URL
        self.FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:5173")
        
        # JWT配置
        self.SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-change-this-in-production-please-use-random-string")
        self.ALGORITHM = os.getenv("ALGORITHM", "HS256")
        self.ACCESS_TOKEN_EXPIRE_HOURS = int(os.getenv("ACCESS_TOKEN_EXPIRE_HOURS", "24"))
        
        # 数据库配置
        self.DATABASE_URL = os.getenv(
            "DATABASE_URL",
            "mysql+pymysql://root:12345@localhost:3306/redbook1?charset=utf8mb4"
        )
        
        # 百度OCR配置
        self.BAIDU_OCR_API_KEY = os.getenv("BAIDU_OCR_API_KEY", "XTXDYTQ8sySTfexUIuCMBQCt")
        self.BAIDU_OCR_SECRET_KEY = os.getenv("BAIDU_OCR_SECRET_KEY", "wtRLBlFwZz5IiuoE2Gkn3dnYQ3VoXBOu")



settings = Settings()
